﻿@model IEnumerable<DraggingAndSorting.Models.SortableThing>

@{
	ViewBag.Title = "Index";
	Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>Sorting</h1>
<table id="table-sortable" class="table table-bordered table-striped table-hover table-responsive">
	<caption>Sortable things</caption>
	<thead>
		<tr>
			<th>@Html.DisplayNameFor(model => model.Number)</th>
			<th>@Html.DisplayNameFor(model => model.Text)</th>
			<th>@Html.DisplayNameFor(model => model.IsEven)</th>
			<th class="table-actions">Actions</th>
		</tr>
	</thead>
	<tbody>
		@foreach (var item in Model) {
			<tr>
				<td>
					@Html.DisplayFor(modelItem => item.Number)
				</td>
				<td>
					@Html.DisplayFor(modelItem => item.Text)
				</td>
				<td>
					@Html.DisplayFor(modelItem => item.IsEven)
				</td>
				<td>
					<span class="glyphicon glyphicon-sort pull-left handle"></span>
					<span class="glyphicon glyphicon-trash pull-right trash"></span>
				</td>
			</tr>
		}
	</tbody>
</table>

@section scripts
{
	<script type="text/javascript">
		$(function() {
			DGON_DOTNET.Sortable.makeSortable('#table-sortable');
		});
	</script>
}
